package com.example.service.util.properties;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @Author juzipi
 * @Date 2021/7/16 11:03
 * @Info 模块之间做区分
 */
@Component//这个是指定读取配置文件
public class UserPropertiesVariable {


    /**
     * token配置 读取配置文件
     */

    public static String header;//头部标识

    public static String secret;//密钥

    public static Long expireTime;//过期时间


    @Value(value = "${token.header}")
    public void setTimesLock(String header){
        UserPropertiesVariable.header = header;
    }

    @Value(value = "${token.secret}")
    public void setPeriodTime(String secretKey){
        UserPropertiesVariable.secret = secretKey;
    }

    @Value(value = "${token.expireTime}")
    public void setLockTime(Long expireTime){
        UserPropertiesVariable.expireTime = expireTime;
    }




    /**
     * 微信登录配置属性
     */
    public static String appId;//微信appid

    public static String appSecret;//微信appSecret

    public static String redirectUrl;//重定向url

    public static String yytBaseUrl;//基础请求路径

    @Value("${wx.open.appId}")
    public void setAppId(String appId){
        UserPropertiesVariable.appId = appId;
    }

    @Value("${wx.open.appSecret}")
    public void setAppSecret(String appSecret) {
        UserPropertiesVariable.appSecret = appSecret;
    }

    @Value("${wx.open.redirectUrl}")
    public void setRedirectUrl(String redirectUrl) {
        UserPropertiesVariable.redirectUrl = redirectUrl;
    }

    @Value("${yyt.baseUrl}")
    public void setYytBaseUrl(String yytBaseUrl) {
        UserPropertiesVariable.yytBaseUrl = yytBaseUrl;
    }

}
